package deprecated;

import java.util.HashMap;
import java.util.Map;

public class MatchTar2 {

	
	String[] source;
	String[] tmsource;
	
	static Map<String, String> alignment = new HashMap<String, String>();
	
	public static void findMismatch(String[] source, String[] tmsource){
		
		int posI=0;
		int posS=0;
		
		int startI = 0;
		int startS = 0;
		
		String edit = ""; 
		
		boolean match = false;
		
		
		int maxlen = Math.max(source.length, tmsource.length);
		
		for(int i = 0; i<maxlen; i++){
				
			boolean wordMatch = false;
			
			if(source[i].equals(tmsource[i])){
				wordMatch = true;
			}
			
			
			if(match && !wordMatch){
				startI = posI;
				startS = posS;
				match = false;
				
				
			}else{
				
				if(!match && wordMatch){
					
					mismatch(startI, posI-1, startS, posS-1);
					match = true;
					
				}
			}
			
			if(!edit.equals("del")){
				posI++;
			}
				
			if(!edit.equals("ins")){
				posS++;	
			}
				
		if(!match){
			mismatch(startI, posI, startS, posS);
		}
			
			
		}
		
		
	}
		

	
	
	
	
	private static void mismatch(int startI, int endI, int startS, int endS) {
		
		for(int i = startS; i<=endS; i++){
	//		for(int tpos: alignment){
	//			
	//		}
		}
		
	}



	public static void altMismatch(String[] source, String[] tmsource, String[] tmtarget){
		
		String[] combined = new String[Math.max(source.length, tmsource.length)];
		
		// [der, grüne, baum, ist, groß]
		// [der, baum, am ufer, ist, dick]
		// [the, tree, on the shore, is, thick]
		// <the> grüne <tree is> groß
		// [m, ins, m, del, m, mis]
		
		for (int i=0; i<source.length; i++){
			if(source[i].equals(tmsource[i])){
				combined[i] = "m";
			}
		}
	}


	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
